Skip to content

Bump rails_semantic_logger from 4.20.0 to 5.0.0#921

Merged
mwtrew merged 2 commits into
mainfrom
dependabot/bundler/rails_semantic_logger-5.0.0
Jul 24, 2026
Merged

Bump rails_semantic_logger from 4.20.0 to 5.0.0#921
mwtrew merged 2 commits into
mainfrom
dependabot/bundler/rails_semantic_logger-5.0.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jul 10, 2026

Copy link
Copy Markdown
Contributor

Bumps rails_semantic_logger from 4.20.0 to 5.0.0.

Changelog

Sourced from rails_semantic_logger's changelog.

[5.0.0] - 2026-06-29

  • Bump the major version to keep it in lock step with Semantic Logger v5, and require semantic_logger >= 5.0.
  • Appenders: add a config.rails_semantic_logger.appenders do |appenders| ... end block to declare log destinations by context. The method names the context (when) and the args name the destination (where): add is always created at init, add_server applies when serving requests (defaults to $stdout), and add_console applies inside the Rails console (defaults to $stderr). This replaces the single default log/<env>.log file appender plus the format/filter/ap_options options.
  • Appenders: deprecate the format, ap_options, filter, console_logger, and add_file_appender options in favor of the appenders block. They still work but warn via the deprecator and will be removed in v6.
  • Forking: rely on Semantic Logger v5's automatic reopen-after-fork (the Process._fork / Process.daemon hook reopens appenders in the child, once per process). Remove the now-redundant manual reopen hooks for Passenger, Resque, Spring, and SolidQueue, the rack/rackup daemonize_app overrides, and the DelayedJob plugin. Apps that opt out with SemanticLogger.reopen_on_fork = false are responsible for reopening themselves.
  • ActionMailer: match Rails' subscribe_log_level gating so the deliver and process events are only emitted when the logger is at debug level, and log process at debug to match upstream.
  • ActionMailer: include the full encoded message (mail) in the deliver payload, mirroring Rails' debug-level mail dump.
  • ActionMailer: remove dead code from the log subscriber (the inapplicable log_arguments? branch and an unreachable, self-recursive date-string branch).
  • ActionView: add gc_time to the render_template, render_partial, and render_collection payloads, matching the GC timing Rails now reports.
  • ActionView: emit a Rendered layout completion event (with duration, allocations, and gc_time) to mirror Rails' render_layout subscriber. The upstream ActionView log subscriber is identical across Rails 7.2 / 8.0 / 8.1, so no version-specific behavior is required.
  • ActionView: log under the name ActionView::Base (via ActionView::Base.logger) instead of ActionView, for consistency with the ActiveRecord::Base, ActiveJob::Base, ActionMailer::Base, and ActionController::Base logger names.
  • ActiveJob: add the enqueue_retry, retry_stopped, and discard events (present in Rails since before 7.2 but never reimplemented here, so they previously produced no output).
  • ActiveJob: add the Rails 8.1 Continuation events (interrupt, resume, step_skipped, step_started, step). The handlers are defined unconditionally; on Rails < 8.1 those notifications are never emitted, so no version-specific behavior is required.
  • ActiveJob: fall back to job.enqueue_error when no exception_object is present, matching Rails, so a failed enqueue is no longer logged as a success.
  • ActiveJob: add the aborted branch to perform, logging a halted before_perform callback as an error to match upstream.
  • ActiveJob: add enqueued_at and scheduled_at to the event payload (when applicable), plus executions/wait on retry events and step_name/step_cursor on Continuation step events.
  • ActiveRecord: handle the strict_loading_violation event (previously dropped entirely when our subscriber replaced Rails'), emitting the violation message plus a structured payload (owner, association, and class for non-polymorphic reflections).
  • ActiveRecord: add lock_wait to the sql payload for async queries, matching Rails.
  • ActiveRecord: only set cached in the sql payload when the result was served from the query cache, instead of writing cached: nil on every query.
  • ActiveRecord: filter sensitive bind values via Rails' own ActiveRecord::Base.inspection_filter

... (truncated)

Commits
  • 001d671 README: move container platform recipe to docs
  • f11ebd6 Rewrite README to match docs and the appenders configuration
  • bf4c700 Trim README: move upgrade notes to docs, condense examples
  • 2ca6cf6 Prepare v5.0.0 release: use rubygems semantic_logger 5.0
  • 6756a86 Merge pull request #314 from reidmorrison/fix/activesupport-logger-hijack-141
  • aabc6ec Stop hijacking ActiveSupport::Logger.new when a destination is given
  • 1b5a698 Merge pull request #313 from reidmorrison/feature/subscriber-metrics
  • c237585 Pass class/module constants to SemanticLogger[] instead of strings
  • 2ebe76a ActionView: log under ActionView::Base name
  • c956f1b Emit prototype metrics for info/warn/error log subscriber entries
  • Additional commits viewable in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code labels Jul 10, 2026
Copilot AI review requested due to automatic review settings July 10, 2026 09:22
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code labels Jul 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot can't review bot-authored pull requests automatically. A user with Copilot access can request a review manually.

@cla-bot cla-bot Bot added the cla-signed label Jul 10, 2026
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown

Test coverage

92.17% line coverage reported by SimpleCov.
Run: https://github.com/RaspberryPiFoundation/editor-api/actions/runs/30081349751

@raspberrypiherokubot
raspberrypiherokubot temporarily deployed to editor-api-p-dependabot-5jti6n July 10, 2026 09:29 Inactive
@zetter-rpf

Copy link
Copy Markdown
Contributor

@mwtrew I thought you might be the best person to look at this as it was recently introduced it in #882

@zetter-rpf
zetter-rpf requested a review from mwtrew July 22, 2026 07:45
Bumps [rails_semantic_logger](https://github.com/reidmorrison/rails_semantic_logger) from 4.20.0 to 5.0.0.
- [Changelog](https://github.com/reidmorrison/rails_semantic_logger/blob/main/CHANGELOG.md)
- [Commits](reidmorrison/rails_semantic_logger@v4.20.0...v5.0.0)

---
updated-dependencies:
- dependency-name: rails_semantic_logger
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/bundler/rails_semantic_logger-5.0.0 branch from 4cbc1a2 to 60bc156 Compare July 22, 2026 07:59
Copilot AI review requested due to automatic review settings July 22, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread Gemfile
@raspberrypiherokubot
raspberrypiherokubot temporarily deployed to editor-api-p-dependabot-18vson July 22, 2026 08:05 Inactive
@mwtrew

mwtrew commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Just looking though this and making the recommended changes

Copilot AI review requested due to automatic review settings July 23, 2026 13:15
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 23, 2026 13:15 Inactive
Comment thread config/application.rb
Comment thread config/application.rb

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread config/application.rb Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 15:51
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 23, 2026 15:51 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

config/application.rb:81

  • Logging configuration change drops the previous global config.semantic_logger.application setting and switches non-RAILS_LOG_TO_STDOUT output to :color, which can break JSON log ingestion/aggregation in production. Also, the prior $stdout.sync = true safeguard for stdout logging was removed, which can lead to buffered / delayed logs on platforms like Heroku.
    config.rails_semantic_logger.appenders do |appenders|
      if ENV['RAILS_LOG_TO_STDOUT'].present?
        # Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
        appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
      else

Copilot AI review requested due to automatic review settings July 23, 2026 15:56
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 23, 2026 15:56 Inactive
Comment thread config/application.rb Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

config/application.rb:81

  • In the RailsSemanticLogger v5 appenders DSL, add is for the init context, while add_server applies when serving requests. In the RAILS_LOG_TO_STDOUT branch this uses appenders.add(...), which risks not attaching the STDOUT JSON appender for actual request logging. Also, the prior $stdout.sync = true and config.semantic_logger.application = ... are no longer set, so logs may be buffered and the application name may not be applied as expected.
    config.rails_semantic_logger.appenders do |appenders|
      if ENV['RAILS_LOG_TO_STDOUT'].present?
        # Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
        appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
      else

Copilot AI review requested due to automatic review settings July 24, 2026 08:29
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 24, 2026 08:29 Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 01ca3a0. Configure here.

Comment thread config/application.rb Outdated
Comment thread config/application.rb Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

config/application.rb:87

  • In the non-RAILS_LOG_TO_STDOUT branch, the appender configuration sets application: 'editor-ui' (likely a typo for this service) and adds a base $stdout appender in addition to add_server/add_console, which can result in duplicated output while serving requests and noisy test/CI logs. Also, when logging to STDOUT (Heroku branch) $stdout.sync = true was previously set and is important to avoid buffered/late log delivery.
    config.rails_semantic_logger.appenders do |appenders|
      if ENV['RAILS_LOG_TO_STDOUT'].present?
        # Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
        appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
      else
        appenders.add(file_name: "log/#{Rails.env}.log", formatter: :default, application: 'editor-ui')
        appenders.add(io: $stdout, formatter: :default, application: 'editor-ui')
        appenders.add_server(formatter: :color, application: 'editor-api')  # $stdout while serving
        appenders.add_console(formatter: :color, application: 'editor-api') # $stderr inside `rails console`
      end
    end

Copilot AI review requested due to automatic review settings July 24, 2026 08:41
@mwtrew
mwtrew force-pushed the dependabot/bundler/rails_semantic_logger-5.0.0 branch from 01ca3a0 to 66e63f2 Compare July 24, 2026 08:41
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 24, 2026 08:42 Inactive
@mwtrew mwtrew self-assigned this Jul 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

config/application.rb:86

  • In the non-STDOUT branch, both appenders.add(io: $stdout, ...) and appenders.add_server(...) target stdout. Since add is always active and add_server adds an additional destination while serving requests, this will duplicate log output to stdout. This also changes the default formatting away from the previously configured JSON and repeats the application name in multiple places; consider keeping JSON formatting and a single destination per context, and set config.semantic_logger.application once globally.
        appenders.add(file_name: "log/#{Rails.env}.log", formatter: :default, application: 'editor-api')
        appenders.add(io: $stdout, formatter: :default, application: 'editor-api')
        appenders.add_server(formatter: :color, application: 'editor-api')  # $stdout while serving
        appenders.add_console(formatter: :color, application: 'editor-api') # $stderr inside `rails console`
      end

Copilot AI review requested due to automatic review settings July 24, 2026 09:06
@mwtrew
mwtrew force-pushed the dependabot/bundler/rails_semantic_logger-5.0.0 branch from 66e63f2 to 9176f02 Compare July 24, 2026 09:06
@mwtrew
mwtrew temporarily deployed to editor-api-p-dependabot-18vson July 24, 2026 09:06 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

config/application.rb:81

  • When logging to STDOUT, the previous production config also set $stdout.sync = true and set config.semantic_logger.application globally. The new config drops sync (risking buffered logs in non-TTY environments) and instead passes application: into appenders.add, which may not apply consistently across all appenders/log entries. Consider restoring sync and setting the application name via config.semantic_logger.application, keeping the appender config focused on destination/formatter.
    if ENV['RAILS_LOG_TO_STDOUT'].present?
      config.rails_semantic_logger.appenders do |appenders|
        # Log to STDOUT on Heroku in JSON format, where this variable is set automatically.
        appenders.add(io: $stdout, formatter: :json, application: "editor-api@#{ENV['HEROKU_SLUG_COMMIT'] || 'unknown'}")
      end

@mwtrew
mwtrew merged commit 482196f into main Jul 24, 2026
7 checks passed
@mwtrew
mwtrew deleted the dependabot/bundler/rails_semantic_logger-5.0.0 branch July 24, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed dependencies Pull requests that update a dependency file ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants